package com.nothing.controller;

import java.net.URL;
import java.util.ResourceBundle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Controller;

import com.nothing.config.StageManager;
import com.nothing.domain.UserFaceGroup;

import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

/**
 * 显示查询到的人脸
 * @author shíQíang㊚
 */

@Controller
public class ShowCheckFaceController implements Initializable {

	@FXML
	public ImageView showImg;

	@FXML
	private Label name;

	@FXML
	private Label age;
	
	@FXML
	private Label gender;
	
	@FXML
	private Label group;
	
	private String nameText;
	private String ageText;
	private String genderText;
	private String groupText;
	
	 
	@FXML
	private ChoiceBox<UserFaceGroup> groupOptions;

	@Lazy
	@Autowired
	private StageManager stageManager;

	 
	private ObjectProperty<Image> faceProperty = new SimpleObjectProperty<Image>();

	public ShowCheckFaceController(){}
	public ShowCheckFaceController(Image img, String name,String age,String gender,String group){
		
		this.faceProperty.set(img);
		this.nameText = name;
		this.ageText = age;
		this.genderText = gender;
		this.groupText = group;
		 
	}
  

	@Override
	public void initialize(URL location, ResourceBundle resources) { 
		showImg.setFitHeight(150);
		showImg.setFitHeight(200);
		showImg.imageProperty().bind(faceProperty);
		name.setText(nameText);
		age.setText(ageText);
		gender.setText(genderText);
		group.setText(groupText);
	}

}
